package org.future.esb;

import java.util.ArrayList;
import java.util.List;

/**
 *@date   2010-4-12 上午11:35:49
 *@author dycc
 *@file   org.future.esb.Model.java
 */
public class Model {
	private String tagName = "model";
	private String name = "";
	private List<Service> services = new ArrayList<Service>();
	/**
	 * toString
	 */
	public String toString(){
		StringBuilder sb = new StringBuilder();
		sb.append("<" + tagName);
		if(!"".equals(getName())){
			sb.append(" name=\"" + getName() + "\"");
		}
		sb.append(">");
		sb.append("\r\n");
		// add childs
		for(int i=0;i<services.size();i++){
			sb.append(services.get(i));
			sb.append("\r\n");
		}
		// add end element
		sb.append("</" + tagName + ">");
		return sb.toString();
	}
	
	public String getName() {
	    return name;
    }
	public void setName(String name) {
	    this.name = name;
    }
	
	public List<Service> getServices() {
	    return services;
    }
	public void setServices(List<Service> services) {
	    this.services = services;
    }
}
